<?php
/*
Gets the html table to manage people.
*/
function get_dropdown_list_user_type($dropdown_data){
	
	$CI =& get_instance();
	$option_select_list='';
	
	foreach($dropdown_data->result() as $option)
	{
		$option_select_list.=get_option_data_row_user_type($option);
	}
	
	if($dropdown_data->num_rows()==0)
	{
		$option_select_list.="";
	}
	
	return $option_select_list;

}
function get_option_data_row_user_type($option){
	$CI =& get_instance();
	$controller_name=strtolower(get_class($CI));
	$option_data_row='';
	$option_data_row.="<option value='".$option->user_group_id."'>".$option->name."</option>";
	return $option_data_row;
}

/*
Gets the html table to manage people.
*/
function get_dropdown_list_user_type_select($dropdown_data,$group_id){
	
	$CI =& get_instance();
	$option_select_list='';
	
	foreach($dropdown_data->result() as $option)
	{
		$option_select_list.=get_option_data_row_user_type_select($option,$group_id);
	}
	
	if($dropdown_data->num_rows()==0)
	{
		$option_select_list.="";
	}
	
	return $option_select_list;

}
function get_option_data_row_user_type_select($option,$group_id){
	$CI =& get_instance();
	$controller_name=strtolower(get_class($CI));
	$option_data_row='';
	if($option->user_group_id==$group_id){
		$option_data_row.="<option value='".$option->user_group_id."' selected>".$option->name."</option>";	
	}else{
		$option_data_row.="<option value='".$option->user_group_id."'>".$option->name."</option>";
	}
	
	return $option_data_row;
}
